
function* fun(){
    yield 'First blood!';
    yield "Double kill!";
    yield "triple kill!";
    return 'emding'
}
const im=fun()
console.log(im.next());
console.log(im.next());
class app{
    constructor(text,conent){
        this.text=text;
        this.conent=conent
    }
    render(){
        const button=document.createElement('button');
        button.innerHTML=this.text;
        const body=document.querySelector('body');
        button.onclick=this.conent;
        body.appendChild(button)
    }
}
const Abutton=new app('A',function(){console.log('这是A');})
const Bbutton=new app('B',function(){console.log('这是B');})
Abutton.render()
Bbutton.render()